﻿@{
    var isAuthenticated = @Session["isAuthenticated"] != null && ((bool)(@Session["isAuthenticated"]));
    var isAdmin = isAuthenticated && @Session["isAdmin"] != null && ((bool)(@Session["isAdmin"]));   
}
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title</title>
        <link rel="shortcut icon" href="/images/favicon.ico" />
        <link href='/css/fonts.css' rel='stylesheet' type='text/css'>
        <link href='/css/default.css' rel='stylesheet' type='text/css'>
        <!--[if IE 7]><link rel="stylesheet" type="text/css" href="/css/ie.css"><![endif]-->
        @ViewBag.IncludeCSS
        <style type="text/css">
            @ViewBag.PageCSS
        </style>
    </head>

    <body>
        <div id="wrapper">
            <!-- header ---->
            <div id="header_wrapper">
                <header id="header">
                    <div class="line"></div>
                    <!-- logo ---->
                    <h1 class="logo"><a href="/">eLibrary</a></h1>
                    <!-- main nav ---->
                    <nav id="nav">
                        <ul>
                            <li><a href="/">Home</a></li>
                            @if (isAuthenticated)
                            {
                                <li><a href="#">My Portal</a>
                                    <ul>
                                        <li><a href="/my-cart">My Cart</a></li>
                                        <li><a href="/my-order">My Order</a></li>
                                        <li><a href="/my-books">My Books</a></li>
                                        <li><a href="/my-profile">My Profile</a></li>
                                        <li><a href="/shopping-history">Shopping History</a></li>
                                    </ul>
                                </li>
                            }
                            else
                            {
                                <li><a href="/register">Register</a></li>
                                <li><a href="/login">Login</a></li>
                            }
                            @if (isAdmin)
                            {
                                <li><a href="#">Administrative</a>
                                    <ul>
                                        <li><a href="/user-management">Manage Users</a></li>
                                        <li><a href="/administrative/books">Manage Books</a></li>
                                        <li><a href="/administrative/categories">Manage Categories</a></li>
                                        <li><a href="/administrative/feedbacks">Manage Feedbacks</a></li>
                                        <li><a href="/order-management/orders">Manage Orders</a></li>
                                        <li><a href="/order-management/payments">Manage Payments</a></li>
                                    </ul>
                                </li>
                            }
                            <li><a href="/marketplace/search">Search</a></li>
                            <li><a href="/contact-us">Contact Us</a></li>
                            @if (isAuthenticated)
                            {
                                <li><a href="/logout">Logout</a></li>
                            }
                        </ul>
                    </nav>
                </header>
            </div>
            <div class="w1">
                <div class="w2">
                    <!-- main ---->
                    <div id="main">
                        @RenderBody()
                    </div>
                    <div style="height: 25px; width: 100%">
                        &nbsp;
                    </div>
                </div>
                <!-- footer ---->
                <footer id="footer">
                    <div class="footer-holder">
                        <div class="add">
                            <div class="case">
                                <strong class="copyright">Copyright &copy; 2012 e-Library Sdn Bhd. All rights reserved.</strong>
                                <nav class="add-nav">
                                    <ul></ul>
                                </nav>
                            </div>
                        </div>
                    </div>
                </footer>
            </div>
        </div>
        <script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="/js/main.js"></script>
        @ViewBag.IncludeJS
    </body>
</html>
